package com.iemes.controller.pretest.datastatistics;

import java.util.List;
import java.util.Map;

import javax.inject.Inject;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.iemes.controller.index.BaseController;
import com.iemes.entity.PretesDailyProductionFormMap;
import com.iemes.entity.PretesMainTainFormMap;
import com.iemes.mapper.pretest.PreDailyProductionMapper;
import com.iemes.mapper.pretest.PreMainTainMapper;
import com.iemes.plugin.PageView;
import com.iemes.util.Common;
//预发机运行故障日报表

@RequestMapping("/maintain")
@Controller
public class PreMainTainController extends BaseController{
	
	@Inject
	private PreMainTainMapper  premaintainmapper;
	
	@RequestMapping("maintain")
	public String dailyproduction(Model model){
		model.addAttribute("res", findByRes());
		return Common.BACKGROUND_PATH + "/pretest/datastatistics/premaintain_list";
	}
	
	@ResponseBody
	@RequestMapping("maintain_findByPage")
	public PageView findByPage(String pageNow, String pageSize) throws Exception
	{
		PretesMainTainFormMap mainFormMap = getFormMap(PretesMainTainFormMap.class);
		List<Map<String, Object>> pretest = premaintainmapper.getAll(mainFormMap);
		
		LuogicPaging(pageNow, pageSize, pretest);
		pageView.setRecords(pretest);
		return pageView;
	}
	

}
